{% extends 'base.html' %}
{% block title %}首页{% endblock %}
{% block main %}
<div class="banner">
    <img src="/static/img/banner.jpg" alt="">
</div>
<div class="article-list-box">
    {% if not article_list %}
        <div class="article-item" style="text-align: center">
            <span>暂无文章</span>
        </div>
    {% endif %} 
    {% for article in article_list %}
    <div class="article-item">
        <a class="title" href="/article/{{article.id}}" target="_blank">{{article.title}}</a>
        <p class="desc">{{article.content | slice:":100"}}</p>
        <div class="info">
            {% if article.source == '1' %}
                <span class="source" style="background: #99CEA4">原创</span>
            {% elif article.source == '2' %}
                <span class="source" style="background: #84A0FA">转载</span>
            {% endif %}
            <span class="create-time">{{article.create_time}}</span>
        </div>
    </div>
    {% endfor %}
</div>
{% endblock %}
